<% content_for :css do %>
  <%= stylesheet_link_tag 'lite_fetions_index' %>
<% end %>  
<% content_for :javascript do %>
<script type="text/javascript" charset="utf-8">
  function go_to(page) {
    
  }
  
  function h_tab(fetion_id,current_tab) {
    $$('div#lite_fetion_' + fetion_id + '_messages  a.tab').each(function(tab) {
      if(tab != current_tab) {
        tab.className = 'tab head_corner';
      }
    });
    current_tab.className = 'tab head_corner h';
  }
  
  function show_or_hide_messages(fetion_id) {
    if($('lite_fetion_' + fetion_id  + '_messages').style.display == 'none') {
      Effect.BlindDown('lite_fetion_' + fetion_id  + '_messages');
      $('show_or_hide_fetion_' + fetion_id + '_messages').update('隐藏消息');
    } else {
      Effect.BlindUp('lite_fetion_' + fetion_id  + '_messages');
      $('show_or_hide_fetion_' + fetion_id + '_messages').update('查看消息');
    }    
  }
</script>
<% end %>  
<%= render :file => 'infos/_nav_bar.html' %>
<div id="lite_fetion_admin"><div class="head">
  <div class="title">  
    <h1>飞信机器人</h1>
  </div>
  <div class="tools">
    <div class="type">
      <form action="#" id="search_type_form" method="post">
        <input id="lite_fetion_type_id" name="lite_fetion_type_id" value="%" type="hidden">
        <input checked="checked" class="no" id="search_type_all" name="search_type" value="all" type="radio">
        <label for="search_type_all">全部</label>
        <input class="no" id="search_type_actived" name="search_type" value="actived" type="radio">
        <label for="search_type_actived">饱和</label>
        <input class="no" id="search_type_capturing" name="search_type" value="capturing" type="radio">
        <label for="search_type_capturing">空缺</label>
      </form>
    </div>
    <div class="order_by">
      <a class="order_by" href="#" onclick="order_by('updated_at','asc'); return false;" title="降序排序">当前人数↓</a>
      <a class="order_by h" href="#" onclick="order_by('updated_at','asc'); return false;" title="降序排序">饱和度↓</a>
      <%= link_to '新增', new_lite_fetion_url , :class => :new %>
    </div>
  </div>
</div>
<div class="lite_fetions">
  <div class="tip">
    <div class="info">
      共<b><%= @fetions.total_entries %></b>名
    </div>
    <div class="will_paginate">
      <%= remote_will_paginate @fetions %>
    </div>    
  </div>
  <% @fetions.each do |fetion| %>  
  <div id="lite_fetion_<%= fetion.id %>" class="lite_fetion <%= cycle '','h', :name => :lite_fetion %>">
    <%= render :partial => 'detail_in_index.html', :locals => { :fetion => fetion } %>
  </div>
  <script type="text/javascript" charset="utf-8">
    fetion_<%= fetion.id %>_unread_messages('FetionMessage');
  </script>
  <% end %>
  <div class="tip bottom">
    <div class="info">
      共<b><%= @fetions.total_entries %></b>名
    </div>
    <div class="will_paginate">
      <%= remote_will_paginate @fetions %>
    </div>    
  </div>
</div>
</div>
      